Affine Transformations

Introduction

Affine transformations extend the familiar world of linear transformations—rotations, scalings, shearings—by adding one crucial new capability: translation.
This lets us move points around the plane without altering their shape or orientation.

In this article, we explore how translations fit naturally into the same matrix‑based framework you already know, provided we switch from ordinary Euclidean coordinates to homogeneous coordinates.

Why Translation Is Not Linear

A linear transformation $T$ must satisfy:

But translation by a vector $t = (a,b)$ sends $$(x,y) \mapsto (x + a,\, y + b).$$ This fails linearity because:

So translation cannot be represented by a $2 \times 2$ matrix acting on $(x,y)$.

Yet in computer graphics, robotics, and geometry, we want a unified matrix framework.
The solution: homogeneous coordinates.

Homogeneous Coordinates

To incorporate translations into matrix multiplication, we embed 2D points into 3D space:

Key ideas:

This trick allows us to treat translations just like rotations and scalings—using matrices.

Translation Matrices

A translation by $(a,b)$ in homogeneous coordinates is represented by: $$\begin{pmatrix} 1 & 0 & a \\ 0 & 1 & b \\ 0 & 0 & 1 \end{pmatrix}$$ Applying it to a point $(x,y,1)$: $$\begin{pmatrix} 1 & 0 & a \\ 0 & 1 & b \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix} = \begin{pmatrix} x + a \\ y + b \\ 1 \end{pmatrix}$$ This is exactly the translation we want.

Combining Linear and Affine Transformations

Because translations now live inside matrices, we can combine them with rotations, scalings, and shearings simply by multiplying matrices.

Example: rotate then translate: $$\begin{pmatrix} R & t \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} \cos\theta & -\sin\theta & a \\ \sin\theta & \cos\theta & b \\ 0 & 0 & 1 \end{pmatrix}$$ This unified form is called an affine transformation matrix.

Properties:

This is why affine transformations are the backbone of computer graphics and geometric modeling.

Geometric Interpretation

In homogeneous coordinates:

Affine transformations allow us to:

Exercises

  1. Write the translation matrix that moves points by $(3,-2)$.

    Solution

    Translation by $(3,-2)$ $$\begin{pmatrix}1 & 0 & 3 \\ 0 & 1 & -2 \\ 0 & 0 & 1\end{pmatrix}$$
  2. Apply the translation $(a,b)$ to the point $(4,1)$ using homogeneous coordinates.

    Solution

    Apply $(a,b)$ to $(4,1)$ $$(4 + a,\; 1 + b)$$
  3. Convert the Euclidean point $(7,5)$ into homogeneous coordinates.

    Solution

    Homogeneous form of $(7,5)$ $$(7,5,1)$$
  4. Apply the matrix $$\begin{pmatrix}1 & 0 & 2 \\ 0 & 1 & 3 \\ 0 & 0 & 1\end{pmatrix}$$ to the point $(1,1)$.

    Solution

    Apply translation matrix $$(1+2,\; 1+3) = (3,4)$$
  5. Describe in words what the matrix $$\begin{pmatrix}1 & 0 & a \\ 0 & 1 & b \\ 0 & 0 & 1\end{pmatrix}$$ does to any point in the plane.

    Solution

    Description
    It shifts every point by $(a,b)$ without rotating or scaling it.
  6. Combine a scaling by factor $2$ with a translation by $(1,1)$ into a single homogeneous matrix.

    Solution

    Combined scaling + translation $$\begin{pmatrix} 2 & 0 & 1 \\ 0 & 2 & 1 \\ 0 & 0 & 1 \end{pmatrix}$$
  7. True or false: In homogeneous coordinates, the point $(x,y,0)$ represents a location in the plane.

    Solution

    False
    $(x,y,0)$ represents a direction, not a point.
  8. Convert the affine matrix $$\begin{pmatrix}2 & 0 & -1 \\ 0 & 3 & 4 \\ 0 & 0 & 1\end{pmatrix}$$ into a description of its geometric effect.

    Solution

    Geometric effect
    • Scales $x$ by $2$
    • Scales $y$ by $3$
    • Translates by $(-1,4)$